home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr52 / 5333de.zip / 7.PRG < prev    next >
Text File  |  1993-04-03  |  969b  |  42 lines

  1. // Update the client files CA of the Pears
  2. // This variation takes APPEND out of the loop.
  3. // and it takes the CA.dbf out completely.
  4. // and changes all the private variables to local
  5. // and eliminates LOCATE, FOUND(), PADL
  6.  
  7. local I
  8. clear
  9.  
  10. FOR I = 1 TO 6000
  11.    X = NEW_ID("CA")
  12.    ? "REC#"+str(I,4)+"   "
  13.    ?? "string= "+str(memory(0),4)+"K  "+;
  14.                 "free  = "+str(memory(1),4)+"K  "+;
  15.                 "run   = "+str(memory(2),4)+"K  "+;
  16.                 "EMM   = "+str(memory(3),4)+"K  "
  17. next
  18.  
  19. Function NEW_ID(P1)
  20. ***************************************
  21. *
  22. ***************************************
  23. local   R,;   && returns the latest ID
  24.           W,;  && saves the previous workarea chosen
  25.           D
  26.  
  27. W = select()
  28. use IDS NEW
  29. R := "1000"
  30. //locate for DS == PadR(P1, 8)
  31. //if found()
  32. //      D = val(NEWID)+1
  33. //      R := PadL( D, len(trim(NEWID)), "0")
  34.       replace NEWID with R
  35. //endif
  36.  
  37.  
  38. use
  39. select (W)
  40. return R
  41.  
  42.